<!--
 * @Author: taosong 2289713738@qq.com
 * @Date: 2023-12-19 21:46:55
 * @LastEditors: taosong 2289713738@qq.com
 * @LastEditTime: 2023-12-19 21:58:59
 * @FilePath: \vue3.0-study\src\example\bidirectionalBinding\components\bidirectionalBinding.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
-->
<script setup lang="ts">
defineProps({
  modelValue: {
    type: String
  }
})

const emits = defineEmits(['update:modelValue'])

const inputChange = e => {
  console.log('打印的值', e.target.value)
  emits('update:modelValue', e.target.value)
}
</script>

<template>
  <div>
    <input type="text" :value="modelValue" @input="e => inputChange(e)" />
  </div>
</template>

<style lang="scss" scoped></style>
